package com.plug.service;

import com.plug.entity.PlugTaskState;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by admin on 2017/1/16.
 */
@Repository
public interface IPlugTaskStateService {
    /**
     * 添加一条任务状态记录
     * @param plugTaskState
     * @return
     */
    int addTaskState(PlugTaskState plugTaskState);

    /**
     * 更新最后修改时间
     * @param plugTaskState
     * @return
     */
    int updateTime(PlugTaskState plugTaskState);

    /**
     * 分页查询
     * @param page 页码
     * @param size 每页数量
     * @return
     */
    List<Map<String,Object>>  findByPage(int page,int size);

    /**
     * 查总数
     * @return
     */
    int findTotal();

    /**
     * 按任务名字查找
     * @param taskName
     * @return
     */
    PlugTaskState selectByName(String taskName);

    /**
     * 按ID删除
     * @param list
     * @return
     */
    int deleteBatch(List<Integer> list);

    /**
     *  根据任务名称查询 id
     * @param taskNames
     * @return
     */
    List<Integer> selectIdByname(List<String> taskNames);
}
